home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Jul 89 / W0138-Nasty B9 Bug Squash-Jul89 < prev    next >
Encoding:
Text File  |  1989-08-22  |  2.6 KB  |  74 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  SHEBANOW1    to CHEWBACCA
  2.  
  3. Item    1781690                         29-July-89        21:41
  4.  
  5. From:   D2086                           Efficient Field Svc, C Faith, PRT
  6.  
  7. To:     MACDTS                          Macintosh Developer Technical Supt.
  8.         MACAPP.TEST                     MacApp SQA Team
  9.         MACAPP.TECH$                    MACAPP Tech
  10.  
  11. Sub:    Nasty B9 Bug Squashed!
  12.  
  13. Hello,
  14.  
  15. I'm back with good news.  I just traced the problem I am having with
  16. InitUObject even further down to a single instruction in GetClassNamesFromID,
  17. and have since figured out exactly how the bug manifests itself as well as a
  18. reasonable workaround.
  19.  
  20. The stack frames get messed up just after the move statement below:
  21.  
  22. GETCLASSNAMEFROMID
  23.    +00A0  002053D4  1694            •*MOVE.B     (A4),(A3)
  24.  
  25. This line corresponds exactly with the pascal statement:
  26.             clNamePtr^ := namePtr^;
  27.  
  28. Here is the stack frame before this statement:
  29.   Frame Addr  Frame Owner          Called From
  30.   <main>      MYAPP
  31.   $0027BDD6   INITUMACAPP          MYAPP.(1)+$0004
  32.   $0027BDBA   INITUOBJECT          INITUMACAPP.(10)
  33.   $0027BDB2   ORDERCLASSIDSBYNAME  INITUOBJECT.(8)
  34.   $0027BCFE   GETCLASSNAMEFROMID   ORDERCLASSIDSBYNAME.(12)+$0006
  35.  
  36. Here I executed an assembly level step and stack command in SADE.  I get the
  37. following stack frame display.
  38.  
  39.   Frame Addr  Frame Owner          Called From
  40.   <main>      INITUOBJECT
  41.   $0027BDB2   ORDERCLASSIDSBYNAME  INITUOBJECT.(8)
  42.   $0027BCFE   GETCLASSNAMEFROMID   ORDERCLASSIDSBYNAME.(12)+$0006
  43.  
  44. GETCLASSNAMEFROMID
  45.    +00A2  002053D6  528B             *ADDQ.L     #$1,A3
  46.  
  47. Now this code is doing exactly what it should ( at least it looks good to me),
  48. so I tried to determine why this would screw up the stack.  Well this statement
  49. only screws up the stack after the 72nd execution of the loop so I looked up
  50. the size of the MAName Type and sure enough it is only 63 for 64 bytes of
  51. storage, hence the routine is copying past the end of the space it should.
  52.  
  53. GetClassNameFromId bombs for any names of length greater than 63.  I am not
  54. sure what the implications of changing the size of MAName are so for now I
  55. shortened up the names of all my methods and classes and everything works fine.
  56.  
  57. What do the names consist of anyway?  My method and class names were long but
  58. maybe 15 to 25 maximum characters not 75.
  59.  
  60. Anyway If you get bombs just after your app starts up try shortening up your
  61. method and class names.
  62.  
  63. I would appreciate it if the MacApp team would comment on the best way to fix
  64. this so that I can use reasonably long identifiers, and so I will be compatible
  65. with the official fix.
  66.  
  67. regards,
  68.  
  69. Curtis Faith
  70.  
  71.  
  72.  
  73.  
  74.